<template>
	<view class="sale-success">
		<view class="flex-center flex-column pt-40 pb-26 img-box">
			<image class="my-24" style="width: 351rpx; height: 214rpx;" src="../static/images/success.png"></image>
			<view class="font-36 code">核销成功</view>
		</view>
		<view class="px-30 pt-48 sale-info-box">
			<view class="sale-info">
				<view class="routine">核销时间：<text>{{saleInfo.lastWriteOffTime}}</text></view>
				<view class="routine">核销人员：<text>{{saleInfo.writeOfUserName}}</text></view>
			
				<view class="routine">入场地点：<text>{{scenicInfo.scenicSpotName}}</text></view>
				<view class="routine">
					已核销次数：<text>{{saleInfo.alreadyWriteOffNumber}}</text>
				</view>
				<view class="btn-box">
					<view class="continue" @click="continueSale">继续核销</view>
					<view class="over" @click="over">完成</view>
				</view>
			</view>
			
		</view>
		
	</view>
</template>

<script>
	export default {
		data() {
			return {
				saleInfo: {},
				type: '1',
				mark: null,
				scenicInfo: null
			}
		},
		onShow() {
			this.scenicInfo = uni.getStorageSync('scenicInfo') || null
		},
		onLoad(options) {
			this.saleInfo = JSON.parse(decodeURIComponent(options.data))
			this.mark = options.mark
		},
		methods: {
			continueSale() {
				if (this.mark == 1) {
					uni.$emit('scan', true)
				}
				uni.navigateBack({
					delta: 1
				})
			},
			over() {
				uni.switchTab({
					url: '/pages/tabbar/home/home'
				})
			}
		}
	}
</script>
<style>
	page {
		background-color: #eee;
	}
</style>
<style lang="scss" scoped>
	.sale-success {

		.img-box {
			background: #FFF;
			padding-bottom: 100rpx;
			image {
				width: 141rpx;
				height: 141rpx;
			}

			.code {
				line-height: 60rpx;
				font-weight: bold;
				color: #01C5C4;
			}
		}
		.sale-info-box {
			width: 100%;
			background: #EEEEEE;
			border-radius: 30rpx 30rpx 0rpx 0rpx;
			margin-top: -40rpx;
			.sale-info {
				background-color: #fff;
				border-radius: 10rpx;
				box-sizing: border-box;
				.routine {
					font-size: 32rpx;
					font-family: Source Han Sans CN;
					font-weight: 500;
					color: #363636;
					height: 102rpx;
					border-top: 1px solid #f5f5f5;
					@include container(30rpx);
					@include flex-just(flex-start, center, row);
				}
			}
			.btn-box {
				margin-top: 100rpx;
				@include flex-just(flex-start, center, column);
				padding-bottom: 80rpx;
				.continue,
				.over {
					width: 440rpx;
					height: 100rpx;
					border-radius: 45rpx;
					line-height: 100rpx;
					text-align: center;
					font-size: 32rpx;
					font-weight: 400;
					margin-bottom: 42rpx;
				}
			
				.continue {
					background: #F4C233;
					color: #000;
				}
			
				.over {
					background: #000;
					color: #fff
				}
			}
		}
		

		
	}
</style>